home *** CD-ROM | disk | FTP | other *** search
- % -----------------------------------------------------------------------------
- % Mini Terminal Demonstration *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.01
- % Filename : MINITERM.TSL
- % Company : SerWiz Comm
- % Programmer : Bo Bendtsen
- % Module created : 06 Aug 1995
- % Latest revision : 09-Aug-1995 by Joop Blokker
- % Language/version : Terminate Prescription 1.00
- % Remarks : Easy demonstration to create the simplest terminal
- %
- % -----------------------------------------------------------------------------
-
- SetTerminal 1
-
- ClearScreen
- WriteAStr 48,25,31," Alt-X=Abort F1=AT&V F2=ATI4 "
- SetAttr 7
-
- print "Interface : "
- Set Interf = GetInterface % Get Interface
- print Interf
- if Interf=0
- Set InterfS = "No Device"
- else
- if Interf=1
- Set InterfS="Uart device"
- else
- if Interf=2
- Set InterfS="INT 14h"
- else
- if Interf=3
- Set InterfS="Fossil"
- else
- If Interf=4
- Set InterfS="DigiBoard"
- else
- Set InterfS = "Unknown"
- endif
- endif
- endif
- endif
- endif
- println " - ",InterfS
-
- print "Port : ", % Get Port number
- Set Port = GetPort
- println Port
-
- print "Baud : ", % Get Baud
- Set Baud = GetBaud
- PrintLn Baud
-
- print "Data bits : ", % Get Databits
- Set DataBits = GetData
- PrintLn DataBits
-
- print "Stop bits : ", % Get Stopbits
- Set StopBits = GetStop
- PrintLn StopBits
-
- print "Parity : ", % Get Parity
- Set ParS = GetParity
- print ParS, " - "
- if ParS = "N"
- Set ParityS = "None"
- else
- if ParS = "O"
- Set ParityS = "Odd"
- else
- if ParS = "E"
- Set ParityS = "Even"
- else
- if ParS = "M"
- Set ParityS = "Mark"
- else
- if ParS = "S"
- Set ParityS = "Space"
- else
- Set ParityS = "Unknown"
- endif
- endif
- endif
- endif
- endif
-
- println ParityS
-
- print "Set Input buffer : ", % Set Input buffer size
- Set InBuf = 1024
- println InBuf
-
- print "Set Output buffer : ", % Set Output buffer size
- Set OutBuf = 1024
- println OutBuf
-
- print "Set Flow Control : ", % Set Flow Control
-
- Set Flow = 1 % init
-
- if Flow=0
- Set FlowS = "None"
- else
- if Flow=1
- Set FlowS = "RTS/CTS"
- else
- if Flow=2
- Set FlowS = "Xon/Xoff"
- else
- if Flow=3
- Set FlowS = "DSR/DTR"
- else
- Set FlowS = "Unknown"
- endif
- endif
- endif
- endif
- println FlowS
- println ""
- Println "Press Enter, please..." % Wait
- WaitEnter
- Scroll 1,1,1,80,20,20,7 % Clear screen partial
-
- % InitDirect Interf, Port, Baud, DataBits, StopBits, ParS, InBuf, OutBuf, Flow
-
- If DeviceResult<>0
- PrintLn "Error opening COM",GetPort
- PrintLn "Result code: ",DeviceResult
- PrintLn "Result text: ",DeviceResultStr(DeviceResult)
- WaitEnter
- Goto End
- Endif
-
- Set Key=0
- Repeat
- If CharsWaiting<>0
- WriteTerminal GetChar
- Endif
- If Keypressed<>0
- Set Key = GetKey
- If Key=315
- Send "AT&V^M"
- Else
- If Key=316
- Send "ATI4^M"
- Else
- Send Chr(Key)
- Endif
- Endif
- Endif
- Until Key=301
-
- % CloseCom
-
- :End
- RemoveWindow
-
-